{template 'admin','header'}
<form action="{$self_dir}/plugins.php?action=search" name="form"  onsubmit="return r_submit(this);">
    <table cellpadding="0" cellspacing="1" class="table_list">
        <caption>插件方法查询</caption>
        <tr>
            <td  class="align_c">
                站点：<select name="siteid" id="siteid" onchange="r_submit(document.forms['form'])">
                  <option value="">所有站点</option>
                  {loop $site_list $key=>$value}
                    <option value="{$key}">{$value}</option>
                  {/loop}
                </select>
                <script>
                    $("#siteid").val("{$siteid}");
                 </script>
                插件：<select name="plug" id="plug" onchange="r_submit(document.forms['form'])">
                  <option value="">所有插件</option>
                  {loop $plug_list $key=>$value}
                    <option value="{$value[0]}">{$value[2]}</option>
                  {/loop}
                </select>
                <script>
                    $("#plug").val("{$plug}");
                 </script>
                 钩子：<select name="hook" id="hook" onchange="r_submit(document.forms['form'])">
                  <option value="">所有钩子</option>
                  {loop $hook_list $key=>$value}
                    <option value="{$key}">{$key}</option>
                  {/loop}
                </select>
                <script>
                    $("#hook").val("{$hook}");
                 </script>
            </td>
        </tr>
    </table>
    </form>
<form action="admin/perm.php?action=listorder" name="form1"  method="POST" onsubmit="return r_submit(this);">
    <table cellpadding="0" cellspacing="1" class="table_list">
        <caption>插件方法管理</caption>
        <tr>
            <th>插件</th>
            <th>站点</th>
            <th>方法</th>
            <th>对应钩子</th>
            <th width="320">管理操作</th>
        </tr>
        {loop $data $d}
        <tr>
	        <td class="align_l"> 
	        {$d['plugins']}<br>
	        {if isset($plug_list[$d['plugins']])}
	        	{$plug_list[$d['plugins']][2]}
	        {else}
	        	<font color="red">未知插件</font>
	        {/if}
	        </td>
	        <td class="align_l">
	        {if empty($d['siteid'])}
	        	所有站点
	        {elseif isset($site_list[$d['siteid']])}
	        	{$site_list[$d['siteid']]}
	        {else}
	        	 <font color="red">未知站点</font>
	        {/if}
	        </td>
	        <td class="align_l">
	        {$d['func']}<br>
	        {$d['funcinfo']}
	        </td>
	        <td class="align_l">
	        {$d['hook']}<br>
	        {if isset($hook_list[$d['hook']])}
	        	{$hook_list[$d['hook']]}
	        {else}
	        	<font color="red">未定义的钩子</font>
	        {/if}
	        </td>
			<td class="align_c">
			{if $d['status']==99}
			<a href="javascript:my_request('{$self_dir}/plugins.php?action=status&id={$d['id']}')">禁用</a>
			{else}
			<a href="javascript:my_request('{$self_dir}/plugins.php?action=status&id={$d['id']}')">启用</a>
			{/if}
			<a href="javascript:my_request('{$self_dir}/plugins.php?action=delete&id={$d['id']}','您确认要删除吗')">删除</a>
			</td>
        </tr>
        {/loop}
        
    </table>
    <div class="button_box">
       <input class="button_style" name="add" type="button" value=" 添加关联 " onclick="self.location='{$self_url}?action=add&forward={$forward}'"/>
    </div>
    </form>
{template 'admin','footer'}